package com.example.springboot.ytest.ytest;

import java.util.ArrayList;
import java.util.List;

public class ArrayListTest {
	public static void main(String[] args) {
		List<Integer> lists = new ArrayList<>(1);
		
		System.out.println(lists.get(0));
	}
}
//运行报异常
//Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
//at java.util.ArrayList.rangeCheck(Unknown Source)
//at java.util.ArrayList.get(Unknown Source)
//at com.yeyi.ytest.ArrayListTest.main(ArrayListTest.java:9)